<template>
  <!-- close:关闭时的回调，点击xx按钮也会执行 -->
  <el-dialog title="图片二维码" :visible="value" @close="closeEvent">
    <div style="text-align: center">
      <canvas ref="canvas" />
    </div>
  </el-dialog>
</template>
<script>
import Qrcode from 'qrcode'
export default {
  props: {
    value: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      //   showShow: false
    }
  },
  methods: {
    closeEvent() {
      // 关闭弹框
      this.$emit('input', false)
    },
    createCode(url) {
      console.log('this.$refs.canvas', this.$refs.canvas)
      // resetFields()// 重置表单成初始值
      Qrcode.toCanvas(this.$refs.canvas, url, { width: 500 })
    }
  }
}
</script>
<style></style>
